import java.util.Scanner;

public class shiyan1_3 {
    public static void main(String[] args){
        String userInput;
        int num;
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入移位位数:");
        num = Integer.parseInt(scan.nextLine());
        System.out.println("请输入要加密的数据:");
        userInput = scan.nextLine();
        char input[] = userInput.toCharArray();
        for(int i = 0;i<userInput.length();i++){
           input[i] = (char)((input[i]+num)%26+97);
        }
        System.out.println("加密后的数据是:");
        System.out.println(String.valueOf(input));
        scan.close();
    }
}
